﻿using System;
using System.IO;
using EnvDTE;
using EnvDTE80;

namespace VsTortoiseSVN.Commands
{

    public class ActiveProjectLog : ActiveProjectBase
    {
        /// <summary>
        /// Constructor
        /// </summary>
        public ActiveProjectLog(DTE2 app, string id)
            : base(app, id)
        {
            SaveRequired = false;
        }

        public override vsCommandStatus QueryStatus()
        {
            if (Application.HasProject())
                return vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;

            return vsCommandStatus.vsCommandStatusSupported;
        }

        public override bool Exec()
        {
            string folder = Path.GetDirectoryName(FullName);
            TortoiseProc.ShowLog(folder);
            return true;
        }
    }
}
